import { HttpClient } from "@angular/common/http";
import { ClusterComponent } from "../../../../riskCluster/cluster.component";
import { UniverseBenchmarkModel, SubIndustryBenchmarkModel, IndustryBenchmarkModel } from "../../models/riskBenchmark.model";
import { ChartBenchmarkModel } from "./models/chartBenchmark.model";
import { RiskExposureModel } from "../../models/riskExposure.model";
import { ClusterModelWrapper } from "../../../../riskCluster/cluster.model";
import { ChartExposureModel } from "../../../../../../shared/models/chartExposure.model";
import { ChangeDetectorRef } from "@angular/core";
import { ClusterService } from "../../../../riskCluster/cluster.service";


/**
 * sub industry model
 */
export class SubIndustryModel extends ClusterComponent {
    public primaryName: string;

    public secondaryName: string;

    public universe: UniverseBenchmarkModel;

    public universeExposure: RiskExposureModel[];

    public subIndustry: SubIndustryBenchmarkModel;

    public industry: IndustryBenchmarkModel;

    public benchmarkData: ChartBenchmarkModel[];

    public exposureData: ChartExposureModel[];

    public scatter: RiskExposureModel[];

    public riskClusters: ClusterModelWrapper[];

    public companyClusterCode: string;

    public currentCompany: string;

    public currentCompanyName: string;

    public maxManagement: number;

    public maxExposure: number;

    public subIndustryAverageExposure: number;

    public subIndustryAverageManagement: number;


    public displayRatingDistribution: boolean = false;

    constructor(private modelRef: ChangeDetectorRef) {
        super(modelRef);
    }

    public errorReset(){
        this.primaryName = undefined;
        this.secondaryName = undefined;
        this.universe = undefined;
        this.subIndustry = undefined;
        this.benchmarkData = undefined;
        this.exposureData = undefined;
        this.scatter = undefined;
        this.riskClusters = undefined;
        this.companyClusterCode = undefined;
        this.currentCompany = undefined;
        this.currentCompanyName = undefined;
        this.maxExposure = undefined;
        this.displayRatingDistribution = undefined;
    }
}